package com.yz.api.facade.pay;

import com.yz.model.dto.pay.AlipayNotifyDto;
import com.yz.model.dto.order.PayOrderRequest;
import com.yz.common.resp.BaseResponse;
import com.yz.model.vo.pay.PayVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:支付
 * <p>
 * User:Mr.Du
 * Date:2024/3/14
 * Time:15:28
 */
@Tag(name = "支付接口")
public interface PayFacade {

    @Operation(summary = "支付")
    @Parameters(value = {@Parameter(name = "uid", description = "用户id", in = ParameterIn.HEADER)})
    @PostMapping("/pay/")
    BaseResponse<String> reCharge(@RequestHeader Long uid, @RequestBody PayOrderRequest payOrderRequest);

    @Operation(summary = "支付宝异步通知，支付宝支付后，会回调该接口")
    @PostMapping("/pay/notify")
    String notify(AlipayNotifyDto alipayNotifyDto);

    @Operation(summary = "同步跳转，告诉你是否调用成功，不能拿来判断支付成功")
    @GetMapping("/pay/finish")
    void finish(HttpServletResponse response);

    @Operation(summary = "获取支付列表")
    @GetMapping("/pay/list")
    BaseResponse<List<PayVo>> getPayVoList();
}
